package org.code.mallspringboot.controller;

import org.code.mallspringboot.pojo.CmsPrefrenceArea;
import org.code.mallspringboot.service.CmsPrefrenceAreaService;
import org.code.mallspringboot.vo.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {

    @Autowired
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    @GetMapping("/listAll")
    public CommonResult listAll(){
        List<CmsPrefrenceArea> listAll = cmsPrefrenceAreaService.listAll();
        if (listAll.size() > 0){
            return CommonResult.success(listAll);
        }
        return CommonResult.failed("cms_prefrence_area查询失败");
    }
}
